package com.rede.didiok.admin.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import com.rede.didiok.admin.service.WebConfigService;
import com.rede.didiok.common.utils.R;

// import org.apache.shiro.authz.annotation.RequiresPermissions;



/**
 * 
 *
 * @author Rede
 * @email didiok@foxmail.com
 * @date 2023-08-07 18:21:16
 */
@RestController
@RequestMapping("admin/feign/webConfig")
public class WebConfigController {
    @Autowired
    private WebConfigService webConfigService;


    /**
     * 通过 参数键名 获取参数值
     */
    @RequestMapping(value = "/isOpenLoginType", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R isOpenLoginType(@RequestParam("loginType") String loginType){
        return R.ok().setData(webConfigService.isOpenLoginType(loginType));
    }

    /**
     * 获取一条可用的webConfig
     * @param linkDto
     * @return
     */
    @GetMapping("/getWebConfig")
    R getWebConfig(){
        return R.ok().setData(webConfigService.getEnableWebConfig());
    }
}
